package com.example.wisdommanufactor.activity;

import android.annotation.SuppressLint;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.EditText;

import androidx.annotation.Nullable;
import androidx.appcompat.widget.ContentFrameLayout;

import com.example.wisdommanufactor.R;
import com.example.wisdommanufactor.fragment.BaseFragment;

import me.yokeyword.fragmentation.SupportActivity;

public abstract  class ProxyActivity extends SupportActivity {
    public abstract BaseFragment setRootFragment();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initContainer(savedInstanceState);
    }

    private void initContainer(@Nullable Bundle savedInstanceState) {
        @SuppressLint("RestrictedApi")
        final ContentFrameLayout container = new ContentFrameLayout(this);
        container.setId(R.id.fragment_container);
        setContentView(container);
        if(savedInstanceState == null){
            loadRootFragment(R.id.fragment_container, setRootFragment());
        }





    }
}
